import {Injectable} from "@angular/core";
import {Observable, Subject} from "rxjs";
import {ReplaySubject} from "rxjs/ReplaySubject";
import {LogUtil} from "./log-util";

/**
 *  队列服务
 */
@Injectable()
export class SiteStatusSubject {
  private replaySubject: Subject<any> =  new ReplaySubject(1);

  constructor(){}

  /**
   * 推送报警信息
   */
  pushData(data){
    this.push(data);
  }

  private push(data){
    this.replaySubject.next(data);
  }


  subscribeData(): Observable<any> {
    return this.replaySubject.asObservable();
  }
}
